<div class="modal-dialog" role="" id="loadForm">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">一键导入</h4>
        </div>
        <form style="padding:4%;height:150px;overflow-y:auto;" >
                <div class="form-group">
                   <div>你可以下载我们指定的模板，填好信息后，再上传导入</div><div style="float:right;"><a  href="{:U('Admin/Tax/exitExecl')}">下载模板</a></div>
                </div>
                <div class="form-group">
                    <div>
                        <input id="import" type="file" name="upfile" enctype="multipart/form-data"/>
                    </div>
                </div>
        </form>
    </div>
</div>

<script>
    $('#import').click();
    $('#import').fileupload({
        url: "{:U('Admin/Tax/importExecl')}",
        dataType: "",
        formData: {type: "execl"},
        autoUpload: true,
        beforeSend:function(){
            $('#loadForm').hide();
            common.loading('正在导入，请稍后...');
        },
        done: function (e, data) {
            if(data.result.status == '1'){
                common.closeLoading();
                $("#commonModal").modal('toggle');
                common.alert("提示","税收数据同步成功!<br>" +
                    "总记录"+data.result.msg.total+"条<br>"+
                    "重复记录"+data.result.msg.existsNumber+"条<br>"+
                    "无效记录"+data.result.msg.invalidNumber+"条<br>"+
                    "本轮成功导入"+data.result.msg.importNumber+"条记录<br>"
                    ,function(){
                        common.reload();
                    });
            }else{
                common.closeLoading();
                $("#commonModal").modal('toggle');
                common.alert("提示","税收数据导入失败!" +data.result.msg,function(){
                    common.reload();
                });
            }
        }
    });

</script>
